﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Architecture;
using YJKSparseDistance.ModelLayer;
using YJKRevitKernel.ElementSearchUtility.LinkDocumentSuite;
using YJKInspectModelFunc.ModelLayer;

namespace YJKSparseDistance.ControlLayer
{
	public static class FactoryBeanMaker_EvacuationDistance
	{
		public static FactoryBean<AreaPacker_EvacuationDistance, RoomPacker_EvacuationDistance, BountarySegmentPacker_EvacuationDistance, DoorPacker_EvacuationDistance, ObstructurePacker_EvacuationDistance> GetFactory()
		{
			return new FactoryBean<AreaPacker_EvacuationDistance, RoomPacker_EvacuationDistance, BountarySegmentPacker_EvacuationDistance, DoorPacker_EvacuationDistance, ObstructurePacker_EvacuationDistance>
			{
				UseAreaFactory = new AreaClassFactory<AreaPacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.AreaFactoryMethod),
				RoomFactory = new RoomClassFactory<RoomPacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.RoomFactoryMethod),
				DoorFactory = new DoorClassFactory<DoorPacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.DoorFactoryMethod),
				BoundarySemgentFactory = new BoundarySegmentFactory<BountarySegmentPacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.BoundaryFactoryMethod),
				HostInRoomClassFactory = new HostInRoomClassFactory<ObstructurePacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.HostFactoryMethod)
			};
		}

		public static FactoryBean<BaseAreaPacker, RoomPacker_EvacuationDistance, BountarySegmentPacker_EvacuationDistance, DoorPacker_EvacuationDistance, ObstructurePacker_EvacuationDistance> GetNoneAreaFactory()
		{
			return new FactoryBean<BaseAreaPacker, RoomPacker_EvacuationDistance, BountarySegmentPacker_EvacuationDistance, DoorPacker_EvacuationDistance, ObstructurePacker_EvacuationDistance>
			{
				UseAreaFactory = new AreaClassFactory<BaseAreaPacker>(FactoryBeanMaker_EvacuationDistance.BaseAreaFactoryMethod),
				RoomFactory = new RoomClassFactory<RoomPacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.RoomFactoryMethod),
				DoorFactory = new DoorClassFactory<DoorPacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.DoorFactoryMethod),
				BoundarySemgentFactory = new BoundarySegmentFactory<BountarySegmentPacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.BoundaryFactoryMethod),
				HostInRoomClassFactory = new HostInRoomClassFactory<ObstructurePacker_EvacuationDistance>(FactoryBeanMaker_EvacuationDistance.HostFactoryMethod)
			};
		}

		public static BaseAreaPacker BaseAreaFactoryMethod(Area inputElement, RevitLinkInstance useRevitLinkInstance = null, object[] otherValues = null)
		{
			return new BaseAreaPacker(inputElement, useRevitLinkInstance, otherValues);
		}

		public static RoomPacker_EvacuationDistance RoomFactoryMethod(Room inputValue, RevitLinkInstance useLinkInstance = null)
		{
			return new RoomPacker_EvacuationDistance(inputValue, useLinkInstance);
		}

		public static BountarySegmentPacker_EvacuationDistance BoundaryFactoryMethod(BoundarySegment inputValue, Element boundryElement = null, RevitLinkInstance useLinkInstance = null)
		{
			return new BountarySegmentPacker_EvacuationDistance(inputValue, boundryElement, useLinkInstance);
		}

		public static DoorPacker_EvacuationDistance DoorFactoryMethod(FamilyInstance thisDoor, RevitLinkInstance useLinkInstance = null, ElementGeometryPacker inputGeo = null)
		{
			return new DoorPacker_EvacuationDistance(thisDoor, useLinkInstance, null);
		}

		public static ObstructurePacker_EvacuationDistance HostFactoryMethod(Element inputElement, RevitLinkInstance useRevitLinkInstance = null, object[] otherValues = null)
		{
			return new ObstructurePacker_EvacuationDistance(inputElement, useRevitLinkInstance, otherValues);
		}

		public static AreaPacker_EvacuationDistance AreaFactoryMethod(Area inputElement, RevitLinkInstance useRevitLinkInstance = null, object[] otherValues = null)
		{
			return new AreaPacker_EvacuationDistance(inputElement, useRevitLinkInstance, otherValues);
		}
	}
}
